package com.riddle.util;

import java.io.UnsupportedEncodingException;

public class StringUtil {

	public static boolean isNullOrEmpty(String str) {
		return str == null || str.trim().length() == 0;
	}
	
	public static String replace(String location, String oldStr, String newStr) {
		return location.replace(oldStr, newStr);
	}
	
	public static String urlDecode(String str) {
		String res = null;
		if(str != null) {
			try {
				res = new String(str.getBytes("ISO-8859-1"), "UTF-8");
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
		return res;
	}
}
